home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_asm / srqreset / srqreset.asm < prev    next >
Encoding:
Assembly Source File  |  1988-11-08  |  1.8 KB  |  74 lines

  1.      include macros.asm
  2.      begincom reset
  3.      jmp   initial
  4. ;****************************************************************************
  5. ;
  6. ;   Data Area
  7. ;
  8. ;****************************************************************************
  9.  
  10. ipladdr  label dword           ;hardware reset address
  11.      dw    0
  12.      dw    0FFFFh
  13.  
  14. old15     label dword           ;bios int 15 address
  15. old15off dw    0
  16. old15seg dw    0
  17.  
  18. counter  dw    0
  19.  
  20. ;****************************************************************************
  21. ;
  22. ;   Int 15 Handler
  23. ;
  24. ;****************************************************************************
  25. int15:
  26. chksys:  cmp   ax,8500H        ;is it a sys req?
  27.      jne   kbcheck
  28.      inc   cs:counter
  29.      cmp   cs:counter,3       ;3 strikes?
  30.      je    ipl           ;you're out!
  31. kbcheck:
  32.      cmp   ah,91H           ;is it a keyboard?
  33.      jne   skipit
  34.      mov   cs:counter,0
  35. skipit:
  36.      jmp   cs:old15        ;go to BIOS int 15 handler
  37.  
  38.  
  39. ipl:
  40.      cli               ;make damn sure ints are off
  41.      mov   ax,0           ;set up addressing for core clobber
  42.      mov   es,ax
  43.      mov   di,ax           ;es:di --> low core
  44.      mov   cx,8000h        ;words to clobber
  45.      rep   stosw           ;destroy DOS
  46.      jmp   cs:ipladdr
  47.  
  48.  
  49. endres     equ   $
  50.  
  51. ;****************************************************************************
  52. ;
  53. ;   Initialization
  54. ;
  55. ;****************************************************************************
  56. msg     db    10,13,"Sys Request Reset Program",10,13
  57.      db    "Copyright (C) 1988 by Robert A. Murphy",10,13
  58.      db    "All Rights Reserved.",10,13,'$';
  59. initial:
  60.      mov   ax,3515h        ;get old vector
  61.      int   21h
  62.      mov   old15off,bx
  63.      mov   old15seg,es       ;save old int15
  64.      lea   dx,int15        ;get new int 15
  65.      mov   ax,2515h        ;set new vector
  66.      int   21h
  67.      lea   dx,msg
  68.      mov   ah,9
  69.      int   21h
  70.      lea   dx,endres
  71.      int   27h
  72.  
  73.      endcom reset
  74.